package file.day9_19.day04.homework;

import file.day9_19.day04.Person;

import java.io.*;

public class Test1ReadJava {
    public static void main(String[] args) {
        File file = new File("./JST2208/src/file/day9_19/day04");
        File[] files = file.listFiles(f->f.getName().contains(".java"));

        for(File f : files){

            //String name = f.getName();对于java文件的读取，获取文件名并不适用。
            try (
                    BufferedReader br = new BufferedReader(
                            new InputStreamReader(
                                    new FileInputStream(f)//直接将文件传参
                            )
                    );
                ){
                String line;
                while ((line = br.readLine()) != null){
                    System.out.println(line);
                }



            }catch (IOException e) {
                e.printStackTrace();
            }
//            BufferedReader br = new BufferedReader(ois);

        }











//        try ()
//        {
//
//        }
    }
}
